def transpose(matrix: list) -> list:
    matrix_new = [[0 for _  in range(len(matrix))] for _1 in range(len(matrix[0]))]
    for i in range(len(matrix)):
        for j in range(len(matrix[0])):
            matrix_new[j][i] =  matrix[i][j]
    if (matrix == [[]]):
        return [[]]
    return matrix_new


assert transpose([[1]]) == [[1]]
assert transpose([[1, 2], [3, 4]]) == [[1, 3], [2, 4]]
assert transpose([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]
assert transpose([[1], [1], [1]]) == [[1, 1, 1]]
assert transpose([[]]) == [[]]